package com.jiantong.version.impl.dao;

import com.jiantong.version.model.DrugOrVaccine;
import io.terminus.common.mysql.dao.MyBatisDao;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by mz on 7/9/17.
 *
 */
@Repository
public class DrugOrVaccineDao extends MyBatisDao<DrugOrVaccine>{

    /**
     * 根据类型查询 疫苗 或者 兽药的list
     * @param criteria 参数
     * @return List<DrugOrVaccine>
     */
    public List<DrugOrVaccine> queryListByType(Map<String , Object> criteria){
        return getSqlSession().selectList(sqlId("queryListByType"),criteria);
    }

    public DrugOrVaccine findByCode(Map<String , Object> criteria){
        return getSqlSession().selectOne(sqlId("findByCode"),criteria);
    }
}
